#FROM daocloud.io/library/java:openjdk-8u40-jdk
FROM daocloud.io/library/centos:7

#换源
#COPY sources.list  /etc/apt/sources.list
#RUN  apt-get update
RUN yum update

#运行案例需要这个
RUN yum install which -y
#service 命令
RUN  yum install initscripts -y

#ssh 命令
RUN  yum -y install openssh-clients

#安装sshd
RUN  yum install -y openssl openssh-server

#设置用户密码
ENV ROOT_PASSWORD 123456
RUN echo $ROOT_PASSWORD |passwd --stdin root

#发送密钥到其他服务器开启容后再说，现在不知道有多少服务器
RUN ssh-keygen -t rsa  -f ~/.ssh/id_rsa
RUN cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

RUN yum install rsync -y

#RUN service sshd restart

ADD jdk-8u261-linux-x64.tar.gz /opt/module/
ADD hadoop-2.10.0.tar.gz /opt/module/

ENV JAVA_HOME /opt/module/jdk1.8.0_261
ENV PATH $JAVA_HOME/bin:$PATH

CMD bin/bash